import javax.swing.*;

public class Test {
    public static void main(String[] args) {

        int s = 0;
        try {
            String str = JOptionPane.showInputDialog(null,"输入一个数：");
            s = Integer.parseInt(str);
        }catch (Exception e){
            System.out.println("数值转换异常");
        }
        JOptionPane.showMessageDialog(null,s*s);
    }


}
